/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kungkhies.jms.kungkhie.upload.validate.success;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;

/**
 *
 * @author clayton
 */
public class KungkhieUploadValidateSuccessHandler
{
    
    public void enqueueValidKungkhie(final String kungkhieString)
    {
        jmsTemplate.send("kungkhie.valid.topic", new MessageCreator()
        {
            @Override
            public Message createMessage(Session session) throws JMSException
            {
                return session.createObjectMessage(kungkhieString);
            }
        });
    }
    
    @Autowired
    JmsTemplate jmsTemplate;    
}
